package com.dly.blog.domain.vo;

import com.dly.blog.domain.Permission;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: DaiLiYu
 * @Date: 2023/7/16 19:58
 */
@Data
public class UserVO {

    /**
     * 用户id
     */
    @Schema(description = "主键id")
    private String id;

    /**
     * 用户名
     */
    @Schema(description = "用户名")
    private String userName;

    @Schema(description = "用户账号")
    private String userAccount;

    /**
     * 用户次数
     */
    @Schema(description = "次数")
    private Integer frequency;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    private String userEmail;

    /**
     * 头像
     */
    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;


    @Schema(description = "职业")
    private String career;

    @Schema(description = "备注")
    private String remark;

    @Schema(description="角色")
    private List<String> userRoles = new ArrayList<>();

    /**
     * 角色信息
     */
    @Schema(description = "角色信息")
    private List<RoleVO> roleVOList;

    /**
     * 权限信息
     */
    @Schema(description = "权限信息")
    private List<PermissionVO> permissionVOList;
}
